import 'package:boss/textStyle/text_style.dart';
import 'package:boss/ui/widget/shadow_radius_card.dart';
import 'package:hi_common/hi_common.dart';
import 'package:flutter/material.dart';

import 'order_detail_title_value.dart';

class OrderDetailMessage extends StatelessWidget {
  final String title;
  final Map<String, dynamic> items;

  const OrderDetailMessage({
    Key key,
    this.title,
    this.items,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    List<Widget> children = [
      Container(
        margin: EdgeInsets.only(
          bottom: 30.w,
        ),
        child: Text(
          '$title：',
          style: TextStyleConstant().normal_1_32,
        ),
      ),
    ];

    items.forEach((key, val) {
      children.add(OrderDetailTitleValue(
        title: key,
        value: val,
      ));
    });

    return ShadowRadiusCard(
      width: double.infinity,
      padding: EdgeInsets.symmetric(
        horizontal: 30.w,
        vertical: 30.w,
      ),
      margin: EdgeInsets.only(
        bottom: 30.w,
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: children,
      ),
    );
  }
}
